/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package elementsDefense;

/**
 *
 * @author Ricardo
 */
public class Player {
    private int gold;
    private int nexusHitPoints;

    public void set(int gold, int nexusHitPoints){
        this.gold = gold;
        this.nexusHitPoints = nexusHitPoints;
        EBus.firePropertyChange(EBus.Property.GOLD, 0, gold);
        EBus.firePropertyChange(EBus.Property.HITPOINTS, 0, nexusHitPoints);
    }
    
    public void addGold(int amount){
        gold+=amount;
        EBus.firePropertyChange(EBus.Property.GOLD, gold-amount, gold);
    }
    
    public void removeHitpoints(int amount){
        nexusHitPoints-=amount;
        EBus.firePropertyChange(EBus.Property.HITPOINTS, nexusHitPoints-amount, nexusHitPoints);
    }
}
